class Solution(object):
    def convertToTitle(self, n):
        """
        :type n: int
        :rtype: str
        """
        ret = []
        while True:
            n-=1
            if n//26==0:
                ret.append(chr(n+ord('A')))
                break
            else:
                ret.append(chr(n%26+ord('A')))
                n//=26
        ret.reverse()
        return "".join(ret)

print(Solution().convertToTitle(2))